package com.mwf.domain.activity.service.trial.factory;

import com.mwf.domain.activity.model.entity.MarketProductEntity;
import com.mwf.domain.activity.model.entity.TrialBalanceEntity;
import com.mwf.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import com.mwf.domain.activity.model.valobj.SkuVo;
import com.mwf.domain.activity.service.trial.node.RootNode;
import com.mwf.types.design.framework.tree.StrategyHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class DefaultActivityStrategyFactory {
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DynamicContext{
        private GroupBuyActivityDiscountVO groupBuyActivityDiscountVO;
        private SkuVo skuVo;
        private BigDecimal deductionPrice;
        /** 是否可见拼团 */
        private Boolean visible;
        /** 是否可参与进团 */
        private Boolean enable;
    }

    private final RootNode rootNode;

    public DefaultActivityStrategyFactory(RootNode rootNode) {
        this.rootNode = rootNode;
    }

    public StrategyHandler<MarketProductEntity, DynamicContext, TrialBalanceEntity> strategyHandler() {
        return rootNode;
    }


}
